<html>
<head>
  <title>CGU - Crypto - Tests</title>
  <style type="text/css">
    pre {
      font-size: 8pt;
    }
  </style>
</head>
<body>

<script type="text/javascript" src="../lib/cgu.crypto.js"></script>
<script type="text/javascript">
function print() {
  for (var i = 0; i < arguments.length; i += 1)
    document.write(arguments[i]);
  document.write('&nbsp;<br />');
}
</script>
<script type="text/javascript">
document.write('<pre>');

var timeStart = new Date().getTime();

print('= Build Check =');
print();
print('CGU Build: ', !!window.CGU);
print('Version: ', CGU.Version);
print();
print('= Encodings =');
print();
print(CGU.Sequence('AB').str());
print(CGU.Sequence('AB').hex());
print(CGU.Sequence('AB').base32());
print(CGU.Sequence('AB').base64());
print();
print('= Ciphers =');
print();
print('All:   ', CGU.ciphers().join(', '));
print();
print('= UTF-8 Encode =');
print();
print('U+0024  U+00A2  U+20AC');
print('    24    C2A2  E282AC');
print('    ',
  CGU.Sequence(CGU.utf8Encode('\u0024')).base16(), '    ',
  CGU.Sequence(CGU.utf8Encode('\u00A2')).base16(), '  ',
  CGU.Sequence(CGU.utf8Encode('\u20AC')).base16()
);
print();
print(CGU.Sequence(CGU.utf8Encode('\u0024\u00A2\u20AC')).base16());
print();
print();

print(new Date().getTime() - timeStart, 'ms');

document.write('</pre>');
</script>

</body>
</html>
